<?php

/**
 * Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package    Badge
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license    http://www.radcodes.com/license/
 * @version    $Id$
 * @author     Vincent Van <vincent@radcodes.com>
 */

class Badge_Model_Request extends Core_Model_Item_Abstract {
	// Properties
	protected $_searchTriggers = array ();
	
	public function getHref($params = array()) {
		$slug = $this->getSlug ();
		
		$params = array_merge ( array ('route' => 'badge_request_general', 'reset' => true, 'request_id' => $this->request_id, 'action' => 'view' ), $params );
		$route = $params ['route'];
		$reset = $params ['reset'];
		unset ( $params ['route'] );
		unset ( $params ['reset'] );
		return Zend_Controller_Front::getInstance ()->getRouter ()->assemble ( $params, $route, $reset );
	}
	
	public function getBadge() {
		return Engine_Api::_ ()->badge ()->getBadge ( $this->badge_id );
	}
	
	public function getUser() {
		return Engine_Api::_ ()->user ()->getUser ( $this->user_id );
	}

}